package code.c10;

import java.io.IOException;
import java.io.RandomAccessFile;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/11/10 12:00
 * @package code.c10
 * @description 文件说明
 */

public class MyRandomAccessFile {
    public static void main(String[] args) throws IOException {
        RandomAccessFile raf = new RandomAccessFile("./src/code/c10/random.txt","rw");
        raf.writeBoolean(false);
        raf.writeInt(2323);
        raf.writeChar('3');
        raf.writeDouble(32823.32);

        raf.seek(1);
        System.out.println(raf.readInt());
        System.out.println(raf.readDouble());
        System.out.println((char) raf.readChar());

        raf.seek(0);
        System.out.println(raf.readBoolean());

        raf.close();
    }

}
